<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ZipfDistribution (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ZipfDistribution (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ZipfDistribution.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/distribution/WeibullDistribution.html" title="class in org.apache.commons.math3.distribution"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/distribution/ZipfDistribution.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ZipfDistribution.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.commons.math3.distribution.AbstractIntegerDistribution">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.distribution</FONT>
<BR>
Class ZipfDistribution</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html" title="class in org.apache.commons.math3.distribution">org.apache.commons.math3.distribution.AbstractIntegerDistribution</A>
      <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.distribution.ZipfDistribution</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io">Serializable</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/IntegerDistribution.html" title="interface in org.apache.commons.math3.distribution">IntegerDistribution</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>ZipfDistribution</B><DT>extends <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html" title="class in org.apache.commons.math3.distribution">AbstractIntegerDistribution</A></DL>
</PRE>

<P>
Implementation of the Zipf distribution.
<P>

<P>
<DL>
<DT><B>Version:</B></DT>
  <DD>$Id: ZipfDistribution.java 1416643 2012-12-03 19:37:14Z tn $</DD>
<DT><B>See Also:</B><DD><a href="http://mathworld.wolfram.com/ZipfDistribution.html">Zipf distribution (MathWorld)</a>, 
<A HREF="../../../../../serialized-form.html#org.apache.commons.math3.distribution.ZipfDistribution">Serialized Form</A></DL>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_org.apache.commons.math3.distribution.AbstractIntegerDistribution"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Fields inherited from class org.apache.commons.math3.distribution.<A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html" title="class in org.apache.commons.math3.distribution">AbstractIntegerDistribution</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#random">random</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#randomData">randomData</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#ZipfDistribution(int, double)">ZipfDistribution</A></B>(int&nbsp;numberOfElements,
                 double&nbsp;exponent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a new Zipf distribution with the given number of elements and
 exponent.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#ZipfDistribution(org.apache.commons.math3.random.RandomGenerator, int, double)">ZipfDistribution</A></B>(<A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A>&nbsp;rng,
                 int&nbsp;numberOfElements,
                 double&nbsp;exponent)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a Zipf distribution.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#calculateNumericalMean()">calculateNumericalMean</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used by <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalMean()"><CODE>getNumericalMean()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#calculateNumericalVariance()">calculateNumericalVariance</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Used by <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalVariance()"><CODE>getNumericalVariance()</CODE></A>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#cumulativeProbability(int)">cumulativeProbability</A></B>(int&nbsp;x)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For a random variable <code>X</code> whose values are distributed according
 to this distribution, this method returns <code>P(X &lt;= x)</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getExponent()">getExponent</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the exponent characterizing the distribution.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumberOfElements()">getNumberOfElements</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the number of elements (e.g. corpus size) for the distribution.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalMean()">getNumericalMean</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this method to get the numerical value of the mean of this
 distribution.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalVariance()">getNumericalVariance</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this method to get the numerical value of the variance of this
 distribution.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getSupportLowerBound()">getSupportLowerBound</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Access the lower bound of the support.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getSupportUpperBound()">getSupportUpperBound</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Access the upper bound of the support.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#isSupportConnected()">isSupportConnected</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use this method to get information about whether the support is
 connected, i.e. whether all integers between the lower and upper bound of
 the support are included in the support.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#probability(int)">probability</A></B>(int&nbsp;x)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;For a random variable <code>X</code> whose values are distributed according
 to this distribution, this method returns <code>P(X = x)</code>.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.distribution.AbstractIntegerDistribution"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math3.distribution.<A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html" title="class in org.apache.commons.math3.distribution">AbstractIntegerDistribution</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#cumulativeProbability(int, int)">cumulativeProbability</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#inverseCumulativeProbability(double)">inverseCumulativeProbability</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#reseedRandomGenerator(long)">reseedRandomGenerator</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#sample()">sample</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#sample(int)">sample</A>, <A HREF="../../../../../org/apache/commons/math3/distribution/AbstractIntegerDistribution.html#solveInverseCumulativeProbability(double, int, int)">solveInverseCumulativeProbability</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="ZipfDistribution(int, double)"><!-- --></A><H3>
ZipfDistribution</H3>
<PRE>
public <B>ZipfDistribution</B>(int&nbsp;numberOfElements,
                        double&nbsp;exponent)</PRE>
<DL>
<DD>Create a new Zipf distribution with the given number of elements and
 exponent.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>numberOfElements</CODE> - Number of elements.<DD><CODE>exponent</CODE> - Exponent.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>numberOfElements &lt;= 0</code>
 or <code>exponent &lt;= 0</code>.</DL>
</DL>
<HR>

<A NAME="ZipfDistribution(org.apache.commons.math3.random.RandomGenerator, int, double)"><!-- --></A><H3>
ZipfDistribution</H3>
<PRE>
public <B>ZipfDistribution</B>(<A HREF="../../../../../org/apache/commons/math3/random/RandomGenerator.html" title="interface in org.apache.commons.math3.random">RandomGenerator</A>&nbsp;rng,
                        int&nbsp;numberOfElements,
                        double&nbsp;exponent)
                 throws <A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></PRE>
<DL>
<DD>Creates a Zipf distribution.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>rng</CODE> - Random number generator.<DD><CODE>numberOfElements</CODE> - Number of elements.<DD><CODE>exponent</CODE> - Exponent.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NotStrictlyPositiveException.html" title="class in org.apache.commons.math3.exception">NotStrictlyPositiveException</A></CODE> - if <code>numberOfElements &lt;= 0</code>
 or <code>exponent &lt;= 0</code>.<DT><B>Since:</B></DT>
  <DD>3.1</DD>
</DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getNumberOfElements()"><!-- --></A><H3>
getNumberOfElements</H3>
<PRE>
public int <B>getNumberOfElements</B>()</PRE>
<DL>
<DD>Get the number of elements (e.g. corpus size) for the distribution.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the number of elements</DL>
</DD>
</DL>
<HR>

<A NAME="getExponent()"><!-- --></A><H3>
getExponent</H3>
<PRE>
public double <B>getExponent</B>()</PRE>
<DL>
<DD>Get the exponent characterizing the distribution.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the exponent</DL>
</DD>
</DL>
<HR>

<A NAME="probability(int)"><!-- --></A><H3>
probability</H3>
<PRE>
public double <B>probability</B>(int&nbsp;x)</PRE>
<DL>
<DD>For a random variable <code>X</code> whose values are distributed according
 to this distribution, this method returns <code>P(X = x)</code>. In other
 words, this method represents the probability mass function (PMF)
 for the distribution.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the point at which the PMF is evaluated
<DT><B>Returns:</B><DD>the value of the probability mass function at <code>x</code></DL>
</DD>
</DL>
<HR>

<A NAME="cumulativeProbability(int)"><!-- --></A><H3>
cumulativeProbability</H3>
<PRE>
public double <B>cumulativeProbability</B>(int&nbsp;x)</PRE>
<DL>
<DD>For a random variable <code>X</code> whose values are distributed according
 to this distribution, this method returns <code>P(X &lt;= x)</code>.  In other
 words, this method represents the (cumulative) distribution function
 (CDF) for this distribution.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - the point at which the CDF is evaluated
<DT><B>Returns:</B><DD>the probability that a random variable with this
 distribution takes a value less than or equal to <code>x</code></DL>
</DD>
</DL>
<HR>

<A NAME="getNumericalMean()"><!-- --></A><H3>
getNumericalMean</H3>
<PRE>
public double <B>getNumericalMean</B>()</PRE>
<DL>
<DD>Use this method to get the numerical value of the mean of this
 distribution.

 For number of elements <code>N</code> and exponent <code>s</code>, the mean is
 <code>Hs1 / Hs</code>, where
 <ul>
  <li><code>Hs1 = generalizedHarmonic(N, s - 1)</code>,</li>
  <li><code>Hs = generalizedHarmonic(N, s)</code>.</li>
 </ul>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the mean or <code>Double.NaN</code> if it is not defined</DL>
</DD>
</DL>
<HR>

<A NAME="calculateNumericalMean()"><!-- --></A><H3>
calculateNumericalMean</H3>
<PRE>
protected double <B>calculateNumericalMean</B>()</PRE>
<DL>
<DD>Used by <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalMean()"><CODE>getNumericalMean()</CODE></A>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the mean of this distribution</DL>
</DD>
</DL>
<HR>

<A NAME="getNumericalVariance()"><!-- --></A><H3>
getNumericalVariance</H3>
<PRE>
public double <B>getNumericalVariance</B>()</PRE>
<DL>
<DD>Use this method to get the numerical value of the variance of this
 distribution.

 For number of elements <code>N</code> and exponent <code>s</code>, the mean is
 <code>(Hs2 / Hs) - (Hs1^2 / Hs^2)</code>, where
 <ul>
  <li><code>Hs2 = generalizedHarmonic(N, s - 2)</code>,</li>
  <li><code>Hs1 = generalizedHarmonic(N, s - 1)</code>,</li>
  <li><code>Hs = generalizedHarmonic(N, s)</code>.</li>
 </ul>
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the variance (possibly <code>Double.POSITIVE_INFINITY</code> or
 <code>Double.NaN</code> if it is not defined)</DL>
</DD>
</DL>
<HR>

<A NAME="calculateNumericalVariance()"><!-- --></A><H3>
calculateNumericalVariance</H3>
<PRE>
protected double <B>calculateNumericalVariance</B>()</PRE>
<DL>
<DD>Used by <A HREF="../../../../../org/apache/commons/math3/distribution/ZipfDistribution.html#getNumericalVariance()"><CODE>getNumericalVariance()</CODE></A>.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>the variance of this distribution</DL>
</DD>
</DL>
<HR>

<A NAME="getSupportLowerBound()"><!-- --></A><H3>
getSupportLowerBound</H3>
<PRE>
public int <B>getSupportLowerBound</B>()</PRE>
<DL>
<DD>Access the lower bound of the support. This method must return the same
 value as <code>inverseCumulativeProbability(0)</code>. In other words, this
 method must return
 <p><code>inf {x in Z | P(X <= x) > 0}</code>.</p>

 The lower bound of the support is always 1 no matter the parameters.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>lower bound of the support (always 1)</DL>
</DD>
</DL>
<HR>

<A NAME="getSupportUpperBound()"><!-- --></A><H3>
getSupportUpperBound</H3>
<PRE>
public int <B>getSupportUpperBound</B>()</PRE>
<DL>
<DD>Access the upper bound of the support. This method must return the same
 value as <code>inverseCumulativeProbability(1)</code>. In other words, this
 method must return
 <p><code>inf {x in R | P(X <= x) = 1}</code>.</p>

 The upper bound of the support is the number of elements.
<P>
<DD><DL>

<DT><B>Returns:</B><DD>upper bound of the support</DL>
</DD>
</DL>
<HR>

<A NAME="isSupportConnected()"><!-- --></A><H3>
isSupportConnected</H3>
<PRE>
public boolean <B>isSupportConnected</B>()</PRE>
<DL>
<DD>Use this method to get information about whether the support is
 connected, i.e. whether all integers between the lower and upper bound of
 the support are included in the support.

 The support of this distribution is connected.
<P>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ZipfDistribution.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/distribution/WeibullDistribution.html" title="class in org.apache.commons.math3.distribution"><B>PREV CLASS</B></A>&nbsp;
&nbsp;NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/distribution/ZipfDistribution.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ZipfDistribution.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#fields_inherited_from_class_org.apache.commons.math3.distribution.AbstractIntegerDistribution">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
